shortcutswindow: Clear search entry on unmap
authorMatthias Clasen <mclasen@redhat.com>
Sun, 2 Aug 2020 13:33:52 +0000 (09:33 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 2 Aug 2020 13:33:52 +0000 (09:33 -0400)
Otherwise, the search term will linger around until
somebody clicks the search button again.

Fixes: #2981
gtk/gtkshortcutswindow.c

index 2fede662eb2f1840c6aea08014c821dce07ec940..64add4c38f6807725c8294a29fc8408540961449 100644 (file)
@@ -740,8 +740,8 @@ gtk_shortcuts_window_unmap (GtkWidget *widget)
   GtkShortcutsWindow *self = (GtkShortcutsWindow *)widget;
   GtkShortcutsWindowPrivate *priv = gtk_shortcuts_window_get_instance_private (self);
 
-  if (priv->search_bar)
-    gtk_search_bar_set_search_mode (priv->search_bar, FALSE);
+  gtk_search_bar_set_search_mode (priv->search_bar, FALSE);
+  gtk_editable_set_text (GTK_EDITABLE (priv->search_entry), "");
 
   GTK_WIDGET_CLASS (gtk_shortcuts_window_parent_class)->unmap (widget);
 }